const add_table = [
    "CREATE TABLE IF NOT EXISTS 'chat_message' ("+
    "'user_id' vachar(64) NOT NULL," +
    "'message_id' vachar(64) NOT NULL,"+
    "'session_id' vachar(64),"+
    "'message_type' integer,"+
    "'message_content' TEXT,"+
    "'contact_type' integer,"+
    "'send_user_id' integer,"+
    "'send_user_nick_name' vachar,"+
    "'send_time' DATE,"+
    "'status' integer,"+
    "'file_size' NUMBER,"+
    "'file_name' vachar,"+
    "'file_type' vachar,"+
    "'file_path' vachar "+
    // "PRIMARY KEY ('user_id', 'message_id')"+
    ");",
    "CREATE TABLE IF NOT EXISTS 'chat_session_user' ("+
    "'user_id' vachar(64) NOT NULL," +
    "'contact_id' vachar(64) not null," +
    "'contact_type' integer,"+
    "'session_id' vachar(64),"+
    "'status' integer DEFAULT 1,"+
    "'contact_name' vachar(64),"+
    "'last_message' text,"+
    "'last_receive_time' bigint,"+
    "'no_read_coun' integer default 0,"+
    "'member_count' integer,"+
    "'top_type' integer default 0,"+
    "'avatar' vachar(100),"+
    "PRIMARY KEY ('user_id', 'contact_id')"+
    ");",
    "CREATE TABLE IF NOT EXISTS 'user_setting' ("+
    "'user_id' vachar(64) NOT NULL," +
    "'email' vachar(64) not null," +
    "'sys_setting' vachar(64),"+
    "'contact_no_read' vachar,"+
    "'server_port' integer,"+
    "PRIMARY KEY ('user_id')"+
    ");"
]


const add_index = [
    "create index if not exists idx_session_id" +
    " on chat_message(" +
    " session_id asc" +
    ");"
]

const alter_tables = [
    {
        tableName: "user_setting",
        field: 'email',
        sql: ""
    }
]

export{
    add_table,
    add_index,
    alter_tables
}